# !/usr/bin/env python
# -*- coding: utf-8 -*-

"""
记录请求的日志
"""

import logging

logger_name = "request_api"
logger = logging.getLogger(logger_name)
logger.setLevel(logging.DEBUG)


log_path = "applog/request_api.log"
fh = logging.FileHandler(log_path)
fh.setLevel(logging.DEBUG)

# create formatter
fmt = "%(asctime)-15s %(message)s"
datefmt = "%Y-%m-%d %H:%M:%S"
formatter = logging.Formatter(fmt, datefmt)

# add handler and formatter to logger
fh.setFormatter(formatter)
logger.addHandler(fh)

